Skip to content

docs: author the proof-needs inventory (P-/F-/K- obligation series)#609

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/lucid-cray-4a22dp
Jun 21, 2026
Merged

docs: author the proof-needs inventory (P-/F-/K- obligation series)#609
hyperpolymath merged 2 commits into
mainfrom
claude/lucid-cray-4a22dp

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Replaces the near-empty docs/PROOF-NEEDS.md (which held only the 2026-03-29 template-ABI cleanup note) with a real, structured inventory of what AffineScript must prove, at what rigour, with honest status — and renames it to .adoc per DOC-FORMAT.

This is the deliverable for a fresh proof-needs review of the repo: what we may have missed before, what's sharpened by outstanding work, and what's newly arisen from the faces work.

The review, in three partitions

P-1…P-10 — pre-faces obligations that existed but were never catalogued. The mechanized core is thinner than the prose corpus suggests:

K-1…K-4 — needs sharpened by outstanding work. Codegen semantic-preservation (#513 must-have 7) is the keystone every face rests on; effect-soundness is blocked (not merely unproven) by the #555 handler mis-lowering; borrow soundness must be stated to reject the #554 counterexample.

F-1…F-7 — NEW obligations from the faces work, entirely absent from the #513 programme:

  • F-1 transformer semantics-preservation (the real same-cube theorem — front-end analogue of K-1)
  • F-2 same-cube cross-face agreement — partially mechanized in invariant-path/proofs/SameCube.agda (unit-tail case); the value-returning divergence is the concrete instance Face transformers disagree on trailing-statement lowering — greet compiles to 2 wasm classes #601
  • F-3 pragma-detection determinism/totality/confluence (lib/face_pragma.ml)
  • F-4 error-vocabulary faithfulness (lib/face.ml — a simulation, beyond OCaml's exhaustiveness check)
  • F-5 render_ty injectivity / non-collision
  • F-6 preview round-trip totality
  • F-7 face confluence with canonicalisation

Also catalogues the aggregate-library law-conformance obligation (cross-cube, vs faces' cross-face) and points the same-cube track at invariant-path's SameCube.agda + verify-same-cube.sh.

Also in this PR

  • Rename docs/PROOF-NEEDS.mddocs/PROOF-NEEDS.adoc (DOC-FORMAT).
  • Update the three referrers: docs/NAVIGATION.adoc, .machine_readable/integrations/verisimdb.a2ml, and spec/FRG-PROFILE.adoc — the FRG "no PROOF-NEEDS" honest gap is now met (path-to-D step 6 done; grade unchanged, still no formal/ prover encoding).

Scope / non-goals

This is a catalogue of obligations only — no proof is asserted discharged, no code changes, no relicensing. Every Status column entry of stated/prose/absent means not proven. Cross-referenced to #513 (it adds the faces + aLib obligations #513 omits) and #563.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KPG9mEQXFyA3k7NWAzMNMr


Generated by Claude Code

Replace the near-empty PROOF-NEEDS.md (which held only the 2026-03-29
template-ABI cleanup note) with a real, structured inventory of what
AffineScript must prove, at what rigour, with honest status.

Three partitions, answering the "what did we miss" review directly:

  P-1..P-10  Pre-faces obligations that existed but were never catalogued
             — solo-core is statements-only (Step has no constructors;
             progress/preservation are ?todo holes), the seven academic
             proofs are prose, mechanized/ is stubs, formal/ is absent,
             and the open soundness holes (#554/#555/#556/#558/#559) had
             no proof obligations linking them to the soundness arguments
             they falsify.

  K-1..K-4   Needs sharpened by outstanding work — codegen semantic-
             preservation (#513 #7) is the keystone every face rests on;
             effect-soundness is *blocked* (not merely unproven) by #555;
             borrow soundness must be stated to reject #554.

  F-1..F-7   NEW obligations from the faces work, entirely absent from the
             #513 programme: transformer semantics-preservation (the real
             same-cube theorem), same-cube cross-face agreement (partially
             mechanized in invariant-path/proofs/SameCube.agda; divergence
             instance #601), pragma-detection determinism, error-vocabulary
             faithfulness, render_ty non-collision, preview round-trip,
             face confluence.

Also catalogues the aggregate-library law-conformance obligation and points
the same-cube track at invariant-path's SameCube.agda + verify-same-cube.sh.

Rename .md -> .adoc per DOC-FORMAT; update the three referrers (NAVIGATION,
verisimdb integration, FRG-PROFILE) — FRG-PROFILE's "no PROOF-NEEDS" honest
gap is now met (path-to-D step 6 done; grade unchanged, still no formal/).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KPG9mEQXFyA3k7NWAzMNMr
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 43 issues detected

Severity Count
🔴 Critical 2
🟠 High 25
🟡 Medium 16

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action denoland/setup-deno@v2 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affinescript-cli/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (2 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affine-vscode/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-vite/src/affine-plugin-improved.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (32 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/wasm_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (29 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/affine_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (2 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/panic.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/alloc.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath marked this pull request as ready for review June 20, 2026 20:08
@hyperpolymath hyperpolymath enabled auto-merge (squash) June 20, 2026 20:08
@hyperpolymath hyperpolymath disabled auto-merge June 20, 2026 21:42
@hyperpolymath hyperpolymath enabled auto-merge (squash) June 20, 2026 21:57
@hyperpolymath hyperpolymath disabled auto-merge June 20, 2026 23:12
@hyperpolymath hyperpolymath merged commit eae71fd into main Jun 21, 2026
14 checks passed
@hyperpolymath hyperpolymath deleted the claude/lucid-cray-4a22dp branch June 21, 2026 00:10
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 43 issues detected

Severity Count
🔴 Critical 2
🟠 High 25
🟡 Medium 16

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action denoland/setup-deno@v2 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affinescript-cli/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (2 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affine-vscode/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-vite/src/affine-plugin-improved.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (32 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/wasm_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (29 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/affine_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (2 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/panic.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/alloc.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

hyperpolymath added a commit that referenced this pull request Jun 21, 2026
## What

Merges current `main` into `feat/solo-core-metatheory-proofs` and
resolves all conflicts, so that **#614 stops being `mergeable_state:
dirty`**. While #614 is dirty, GitHub cannot build the merge commit, so
its entire CI suite is suppressed (only `lint-workflows` runs). Merging
this PR into the feature branch un-blocks #614's CI.

## Why it was needed

#614 branched off an old `main` (merge-base 61 commits back) and
conflicts with the standalone-CI + codegen work that has since landed
(#602, #603, #604, #606, #609, #610, #611, #612, #613).

## Conflict resolutions (5 files)

| File(s) | Resolution |
|---|---|
| `governance.yml`, `scorecard.yml`, `scorecard-enforcer.yml`,
`hypatia-scan.yml` | Take `main`'s **standalone** versions. The branch
re-adopted the estate `standards` reusables that `main` deliberately
dropped (#603/#604) to stop run-creation `startup_failure`s. `main`'s
`hypatia-scan.yml` also restores the permissions Hypatia needs
(`security-events: write`, `pull-requests: write`, `secrets: inherit`)
and the `MPL-2.0` SPDX id the Palimpsest license doc mandates for
tooling. |
| `docs/PROOF-NEEDS.md` | Drop the branch's stale 103-line `.md`; keep
`main`'s canonical 359-line `.adoc` (#609). Also satisfies DOC-FORMAT. |
| `docs/history/MODULE-SYSTEM-PROGRESS` | Keep the branch's
`.md`→`.adoc` migration; **port** `main`'s additive #138
codegen-follow-up note + status-table row into the `.adoc` so `main`'s
work is preserved. |

`spark-theatre-gate.yml` and `mirror.yml` were identical to `main`.

## Verification (merged tree)

- `dune build` — clean
- `dune test` — **534/534 pass** (incl. `cross-module constructor
linking, Wasm (#138)`, `Wasm nested tuple patterns`, `Deno-ESM / JS no
duplicate Option/Result constructor`)
- wasm-runtime harness (`tools/run_codegen_wasm_tests.sh`) — all pass
- workflow scan — no `startup_failure` risk introduced

## How to use

Merge this into `feat/solo-core-metatheory-proofs`. #614 then becomes
mergeable and its full CI runs.

> Routed via this branch because the environment only permits pushes to
`claude/inspiring-newton-dg5wov`, not directly to the feature branch.

Un-blocks #614.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Lz7pRcec2Z3tVtaAhvB3M8

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Lz7pRcec2Z3tVtaAhvB3M8)_

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hyperpolymath <paraordinate@yahoo.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant